import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ServletPLP extends HttpServlet {

    public static final String mainPath = "C:\\java\\webapps\\plp\\execucao\\";
    public static final int Expressoes1 = 0;
    public static final int Expressoes2 = 1;
    public static final int Funcional1 = 2;
    public static final int Funcional2 = 3;
    public static final int Imperativa1 = 4;
    public static final int Imperativa2 = 5;
    public static final int OrientadaAObjetos1 = 6;
    public static final int OrientadaAObjetos2 = 7;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
                                  throws ServletException, java.io.IOException {
        PrintWriter out;
        StringBuffer resposta = new StringBuffer();
        response.setContentType("text/html");
    	out = response.getWriter();
        try {
            String file = ServletPLP.mainPath + "index";
            resposta.append(Library.getFile(file+"1.html"));
            resposta.append(Library.getFile(file+"2.html"));
        }
        catch (Exception exception) {
            resposta = new StringBuffer();
            resposta.append(exception.getMessage());
        }
        finally {
            out.println(resposta.toString());
            out.close();
        }
    }
}